package com.songcan.gateway.listener;

import com.songcan.gateway.route.service.CustomRouteDefinitionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ApplicationStartup  implements ApplicationRunner {
    @Autowired
    private CustomRouteDefinitionService customRouteDefinitionService;

    @Override
    public void run(ApplicationArguments args) {
        log.info("事件监听:{}",args.getNonOptionArgs().toString());
        customRouteDefinitionService.loadRouteDefinition();
    }
}
